﻿
#include "../OLGuiCreator/GuiCreator.hpp"
#include "../OLOperations/ProjectTreeWidgetOperation.hpp"
#include "../OLOperations/PyConsoleWidgetOperation.hpp"


int main(int argc, char* argv[]) {

	NSGuiCreator::GuiCreator gc(argc, argv);
	gc.extractArgs();

	gc.run();

	return 0;
}

//#if defined(_MSC_VER) && (_MSC_VER >= 1600)    
//#pragma execution_character_set("utf-8")    
//#endif

// 必须的VTK模块初始化
//#include <vtkAutoInit.h>
//VTK_MODULE_INIT(vtkRenderingOpenGL2);
//VTK_MODULE_INIT(vtkInteractionStyle);
//VTK_MODULE_INIT(vtkRenderingFreeType);



//// FollowerDisableScale_IgnoreScaleInComputeMatrix.cpp
//
//#include <vtkActor.h>
//#include <vtkCamera.h>
//#include <vtkCubeSource.h>
//#include <vtkFollower.h>
//#include <vtkInteractorStyleTrackballCamera.h>
//#include <vtkMath.h>
//#include <vtkNamedColors.h>
//#include <vtkNew.h>
//#include <vtkObjectFactory.h> // Required for vtkStandardNewMacro
//#include <vtkPolyDataMapper.h>
//#include <vtkProperty.h>
//#include <vtkRenderWindow.h>
//#include <vtkRenderWindowInteractor.h>
//#include <vtkRenderer.h>
//#include <vtkTransform.h>
//#include <vtkVectorText.h>
//
//#include <iostream> // For std::cout
//
//// --- 1. Define the custom vtkFollower class ---
//class vtkFollowerDisableScale : public vtkFollower
//{
//public:
//    static vtkFollowerDisableScale* New();
//    vtkTypeMacro(vtkFollowerDisableScale, vtkFollower);
//
//protected:
//    vtkFollowerDisableScale() = default;
//    ~vtkFollowerDisableScale() override = default;
//
//    // --- 2. Override ComputeMatrix to ignore Scale ---
//    void ComputeMatrix() override;
//
//private:
//    // Prevent copying
//    vtkFollowerDisableScale(const vtkFollowerDisableScale&) = delete;
//    void operator=(const vtkFollowerDisableScale&) = delete;
//};
//
//// --- 3. Implement the VTK standard macros ---
//vtkStandardNewMacro(vtkFollowerDisableScale);
//
//// --- 4. Implement the overridden ComputeMatrix method ---
//void vtkFollowerDisableScale::ComputeMatrix()
//{
//    // check whether or not need to rebuild the matrix
//    if (this->GetMTime() > this->MatrixMTime ||
//        (this->Camera && this->Camera->GetMTime() > this->MatrixMTime))
//    {
//
//        this->GetOrientation();
//        this->Transform->Push();
//        this->Transform->Identity();
//        this->Transform->PostMultiply();
//
//        if (this->Camera)
//        {
//            double* pos, * vup, distance;
//            double Rx[3], Ry[3], Rz[3];
//            vtkMatrix4x4* matrix = this->InternalMatrix;
//            matrix->Identity();
//            pos = this->Camera->GetPosition();
//            distance = sqrt((pos[0] - this->Position[0]) * (pos[0] - this->Position[0]) +
//                (pos[1] - this->Position[1]) * (pos[1] - this->Position[1]) +
//                (pos[2] - this->Position[2]) * (pos[2] - this->Position[2]));
//
//            this->Transform->Scale(distance / 15, distance / 15, distance / 15);
//            this->Transform->Concatenate(matrix);
//        }
//
//        this->Transform->PreMultiply();
//        this->Transform->GetMatrix(this->Matrix);
//        this->MatrixMTime.Modified();
//        this->Transform->Pop();
//    }
//}
//
//// --- 5. Main function demonstrating the usage ---
//int main(int, char* [])
//{
//    vtkNew<vtkNamedColors> colors;
//
//    // --- Create a reference cube ---
//    vtkNew<vtkCubeSource> cubeSource;
//    cubeSource->SetXLength(2.0);
//    cubeSource->SetYLength(2.0);
//    cubeSource->SetZLength(2.0);
//    vtkNew<vtkPolyDataMapper> cubeMapper;
//    cubeMapper->SetInputConnection(cubeSource->GetOutputPort());
//    vtkNew<vtkActor> cubeActor;
//    cubeActor->SetMapper(cubeMapper);
//    cubeActor->GetProperty()->SetColor(colors->GetColor3d("Crimson").GetData());
//    cubeActor->SetPosition(-3.0, 0.0, 0.0);
//
//    // --- Create another cube with normal scaling for comparison ---
//    vtkNew<vtkCubeSource> scaledCubeSource;
//    vtkNew<vtkPolyDataMapper> scaledCubeMapper;
//    scaledCubeMapper->SetInputConnection(scaledCubeSource->GetOutputPort());
//    vtkNew<vtkActor> scaledCubeActor;
//    scaledCubeActor->SetMapper(scaledCubeMapper);
//    scaledCubeActor->GetProperty()->SetColor(colors->GetColor3d("Blue").GetData());
//    scaledCubeActor->SetPosition(3.0, 0.0, 0.0);
//    scaledCubeActor->SetScale(1.5, 1.5, 1.5); // This will work as expected
//
//    // --- Create the custom follower that ignores scale ---
//    vtkNew<vtkCubeSource> textSource;
//    //textSource->SetText("NoScale!");
//    textSource->SetXLength(1);
//    textSource->SetYLength(1);
//    textSource->SetZLength(1);
//    //textSource->SetCenter(0, 0, 12);
//
//    vtkNew<vtkPolyDataMapper> followerMapper;
//    followerMapper->SetInputConnection(textSource->GetOutputPort());
//
//    // Instantiate our custom class
//    vtkNew<vtkFollowerDisableScale> follower;
//    follower->SetMapper(followerMapper);
//    follower->GetProperty()->SetColor(colors->GetColor3d("Gold").GetData());
//    follower->GetProperty()->SetDiffuse(0.8); // Make lighting more visible
//    follower->GetProperty()->SetSpecular(0.3);
//
//    // --- THIS IS THE TEST: Set a large scale ---
//    // The overridden ComputeMatrix should ignore this.
//    follower->SetScale(5.0, 0.5, 2.0); // <<<--- This scale should have NO effect.
//    std::cout << "Set follower scale to (5.0, 0.5, 2.0). This should be ignored." << std::endl;
//    std::cout << "Follower's internal scale is now: ("
//        << follower->GetScale()[0] << ", "
//        << follower->GetScale()[1] << ", "
//        << follower->GetScale()[2] << ")" << std::endl;
//
//    follower->SetPosition(10.0, 10.0, 10.0);
//
//    // --- Setup rendering ---
//    vtkNew<vtkRenderer> renderer;
//    renderer->AddActor(cubeActor);
//    renderer->AddActor(scaledCubeActor);
//    renderer->AddActor(follower); // Add our custom follower
//
//    // --- CRITICAL: Assign the camera to the follower ---
//    follower->SetCamera(renderer->GetActiveCamera());
//
//    renderer->SetBackground(colors->GetColor3d("SlateGray").GetData());
//    renderer->ResetCamera();
//
//    vtkNew<vtkRenderWindow> renderWindow;
//    renderWindow->AddRenderer(renderer);
//    renderWindow->SetWindowName("VTK Follower Disable Scale (Ignore in ComputeMatrix)");
//    renderWindow->SetSize(800, 600);
//
//    vtkNew<vtkRenderWindowInteractor> renderWindowInteractor;
//    renderWindowInteractor->SetRenderWindow(renderWindow);
//
//    vtkNew<vtkInteractorStyleTrackballCamera> style;
//    renderWindowInteractor->SetInteractorStyle(style);
//
//    // --- Render and start interaction ---
//    renderWindow->Render();
//    // Add some initial rotation for better visualization
//    renderer->GetActiveCamera()->Azimuth(20);
//    renderer->GetActiveCamera()->Elevation(15);
//    renderWindow->Render();
//
//    std::cout << "Running example. The 'NoScale!' text should appear at its original size, "
//        << "ignoring the SetScale(5.0, 0.5, 2.0) call." << std::endl;
//    std::cout << "The blue cube should be visibly larger due to its SetScale(1.5, 1.5, 1.5)." << std::endl;
//    std::cout << "Rotate the view to see the follower always face the camera." << std::endl;
//
//    renderWindowInteractor->Start();
//
//    return EXIT_SUCCESS;
//}
//



